import Vue from 'vue'
import App from '@/App'
import store from '@/store'
import request from '@/utils/request'
import apiUrl from '@/api/api'
import { router, RouterMount } from '@/router/index'
import { jumpToLogin, loginGoPage } from '@/utils/common'

Vue.use(router)

// #ifdef H5
// import '@/lib/sls-wpk-reporter'
if (process.env.VUE_APP_API_ENV === 'test' || process.env.VUE_APP_API_ENV === 'stag') {
  const vconsole = require('vconsole')
  Vue.prototype.$vconsole = new vconsole() // 使用vconsole
}
// #endif

Vue.prototype.$request = request
Vue.prototype.$apiUrl = apiUrl
Vue.prototype.$jumpToLogin = jumpToLogin
Vue.prototype.$loginGoPage = loginGoPage

App.mpType = 'app'
const app = new Vue({
  store,
  ...App,
})

//  v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
RouterMount(app, router, '#app')
// #endif
// #ifndef H5
app.$mount() // 为了兼容小程序及app端必须这样写才有效果
// #endif


